<template>
  <!-- 各临床科室指标完成情况表 -->
  <div>
    <h1>各临床科室指标完成情况表</h1>
    <h3>时期：{{startDate}} ~ {{endDate}}</h3>
    <h2>医院名称:湖北省中医院</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="bqmc" label="病区 简称" align="center" width="150"></el-table-column>
      <el-table-column label="工作效率指标" align="center" width>
        <el-table-column prop="tjz2005" label="出院人数" align="center" width></el-table-column>
        <el-table-column prop="tjz2057" label="床位使用率(%)" align="center" width></el-table-column>
        <el-table-column prop="tjz2058" label="床位周转次" align="center" width></el-table-column>
        <el-table-column prop="tjz2059" label="出院者平均住院日" align="center" width></el-table-column>
        <el-table-column prop="tjz2056" label="平均病床工作日" align="center" width></el-table-column>
        <el-table-column prop="f1" label="手术前平均住院天数" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="工作质量指标(%)" align="center" width>
        <el-table-column prop="tjz2047" label="出入院诊断符合率" align="center" width></el-table-column>
        <el-table-column prop="tjz2053" label="手术前后诊断符合率" align="center" width></el-table-column>
        <el-table-column prop="f2" label="临床病理诊断符合率" align="center" width></el-table-column>
        <el-table-column prop="tjz2050" label="入院三日确诊率" align="center" width></el-table-column>
        <el-table-column prop="tjz2071" label="治愈好转率" align="center" width></el-table-column>
        <el-table-column prop="tjz2060" label="危重病人抢救成功率" align="center" width></el-table-column>
        <el-table-column prop="f4" label="病例医疗质量合格率" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="医疗缺陷" align="center" width>
        <el-table-column prop="tjz2052" label="无菌切口感染率" align="center" width></el-table-column>
        <el-table-column prop="f3" label="医院感染率" align="center" width></el-table-column>
        <el-table-column prop="tjz2055" label="手术并发症发生率" align="center" width></el-table-column>
        <el-table-column prop="tjz2076" label="褥疮发生率" align="center" width></el-table-column>
        <el-table-column prop="tjz2045" label="陪护率" align="center" width></el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { clinicalDepartmentIndexComplete } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        clinicalDepartmentIndexComplete({
          endTime: this.dateList.dateEnd,
          startTime: this.dateList.dateBegin
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始和结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>